﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ISFProject.Models
{
    public class Coach
    {
        [Key]
        public int CoachId { get; set; }

        [Required(ErrorMessage = "Please enter your first name")]
        [StringLength(45, MinimumLength = 3, ErrorMessage = "Invalid field length")]
        [Display(Name = "First name*")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Please enter your last name")]
        [StringLength(45, MinimumLength = 3, ErrorMessage = "Invalid field length")]
        [Display(Name = "Last name*")]
        public string LastName { get; set; }

        [DataType(DataType.Date)]
        [Display(Name = "Date of birth")]
        public DateTime DateOfBirth { get; set; }

        public String Picture { get; set; } //browse pictures

        [Required]
        [EnumDataType(typeof(Gender))]
        public Gender Gender { get; set; }

        [StringLength(45, MinimumLength = 1, ErrorMessage = "Invalid field length")]
        public String Role { get; set; }

        [Required(ErrorMessage = "Please your email address")]
        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Please enter a valid email address")]
        [Display(Name = "Email address*")]
        public String Mail { get; set; }  

        public virtual List<Team> Teams { get; set; }

    }
}